package org.springblade.modules.admin.vo.sugar;

import cn.hutool.core.util.NumberUtil;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description 饼图子项占比vo
 * @Author ysq
 * @Date 2022/1/5
 **/
@Data
public class ChartVO {

	@ApiModelProperty(value = "名称")
	private String name;

	@ApiModelProperty(value = "占比")
	private Double percentage;

	@ApiModelProperty(value = "数量")
	private Long total;

	public void setPercentage(BigDecimal percentage) {
		this.percentage = NumberUtil.mul(percentage,100d).doubleValue();
	}
}
